| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | function getDepartmentDone(jqXHR) |
||
| 2 | { |
||
| 3 | if(jqXHR.status !== 200 || jqXHR.responseJSON === undefined) |
||
| 4 | { |
||
| 5 | alert('Unable to obtain departments!'); |
||
| 6 | return; |
||
| 7 | } |
||
| 8 | var data = jqXHR.responseJSON; |
||
| 9 | var list = $('#departmentName'); |
||
| 10 | for(var i = 0; i < data.length; i++) |
||
| 11 | { |
||
| 12 | list.append('<option value="'+data[i].departmentID+'">'+data[i].departmentName+'</option>'); |
||
| 13 | } |
||
| 14 | if(data.length === 1) |
||
| 15 | { |
||
| 16 | list.attr('disabled', true); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | |||
| 47 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.